package com.suxin.rule;

import com.suxin.rule.abstrct.AddressRule;
import com.suxin.rule.abstrct.NationalityRule;
import com.suxin.rule.dto.RuleDTO;
import com.suxin.rule.service.RuleService;

import java.util.Arrays;

/**
 * @author Tang
 * @classname Client
 * @description [  ]
 * @date 2022/1/9 19:35
 */
public class Client {

    public static void main(String[] args) {

        // 1.条件数据
        RuleDTO dto = new RuleDTO();
        dto.setAge(5);
        dto.setAddress("北京");

        // 2.规则
        NationalityRule nationalityRule = new NationalityRule();
        AddressRule addressRule = new AddressRule();

        boolean result = RuleService.create()
                .and(Arrays.asList(new AddressRule()))
                .or(Arrays.asList(new NationalityRule()))
                .execute(dto);
        System.out.println(result);
    }

}